package cn.edu.hitwh.kanlema.constant;

import java.time.format.DateTimeFormatter;

public class RedisConstants {
    public static final String LOGIN_CODE_KEY = "login:code:";
    public static final Long LOGIN_CODE_TTL = 1L;
    public static final String LOGIN_USER_KEY = "login:token:";
    public static final Long LOGIN_USER_TTL = 3600L;

    public static final Long CACHE_NULL_TTL = 2L;
    public static final String HOT_KEY_LOCK_PREFIX = "lock:hotkey:";
    public static final Long HOT_KEY_LOCK_TTL = 10L;

    public static final Long CACHE_CINEMA_TTL = 30L;
    public static final String CACHE_CINEMA_KEY = "cache:cinema:";
    public static final String CACHE_CINEMA_BLOOM_KEY = "cache:cinema:bloom";
    public static final long CACHE_CINEMA_BLOOM_EXPECTED_INSERTIONS = 1000000L;
    public static final double CACHE_CINEMA_BLOOM_FALSE_PROBABILITY = 0.01;
    public static final String CACHE_HOT_CINEMA_KEY = "cache:cinema:hot";
    public static final Long CACHE_HOT_CINEMA_TTL = 3L;
    public static final String CACHE_HOT_CINEMA_SET_KEY = "cache:cinema:hot:set";

    public static final String CACHE_CINEMA_TYPE_KEY = "cache:cinema:type";
    public static final Long CACHE_CINEMA_TYPE_TTL = 1L;

    public static final String CACHE_VOUCHER_PRELOAD_FLAG_KEY = "cache:voucher:preload:flag";
    public static final String CACHE_VOUCHER_KEY = "cache:voucher:";
    public static final String CACHE_VOUCHER_STOCK_HKEY = "stock";
    public static final String CACHE_VOUCHER_BEGIN_TIME_HKEY = "beginTime";
    public static final String CACHE_VOUCHER_END_TIME_HKEY = "endTime";
    public static final String CACHE_VOUCHER_USER_KEY = "cache:voucher:user:";
    public static final String VOUCHER_OF_CINEMA_KEY = "cache:voucher:cinema:";
    public static final long CACHE_VOUCHER_OF_CINEMA_TTL = 1L;

    public static final String BLOG_LIKED_KEY = "blog:liked:";

    public static final String BLOG_FEED_KEY = "blog:feed:";
    public static final Long BLOG_FEED_CAPACITY = 10L;
    public static final String BLOG_FEED_LOCK_KEY = "blog:feed:lock";

    public static final String SIGN_KEY = "sign:";
    public static final DateTimeFormatter SIGN_KEY_MONTH_FORMATTER = DateTimeFormatter.ofPattern("yyyy:MM:");
    public static final Long SIGN_KEY_TTL = 60L * 24;
}
